<!--
/**************************************************
* @(#)systemparam.jsp
*
* Copyright (c) 2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/02/08, SimonyiPeng
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.*"%>
<%@ include file="../../common.jsp" %>
<html>
<head>
<title>系统参数设置</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>
</head>

<script language='javascript'>
<%
if(request.getAttribute("MSG") != null){
	out.print("alert('"+request.getAttribute("MSG")+"');");
}
%>

	function saveForm()
	{
		if(document.all.datetype.value == null || document.all.datetype.value == "")
		{
			alert("请选择结算日期类型！");
			return false;
		}
		if(document.all.period.value == null || document.all.period.value == "")
		{
			alert("请录入应收应付提醒周期！");
			return false;
		}

		if(document.all.startdate.value == null || document.all.startdate.value == "")
		{
			alert("请录入结算日期开始区间！");
			return false;
		}
		if(!isNum(document.all.startdate.value) || !isNum(document.all.enddate.value))
		{
			alert("非法的录入值！");
			return false;
		}
		if(document.all.enddate.value == null || document.all.enddate.value == "")
		{
			alert("请录入结算日期终止区间！");
			return false;
		}
		if(parseInt(document.all.startdate.value) > 31 || parseInt(document.all.startdate.value) < 0)
		{
			alert("请录入正常的结算日期开始区间！");
			return false;
		}
		if(parseInt(document.all.enddate.value) > 31 || parseInt(document.all.enddate.value) < 0)
		{
			alert("请录入正常的结算日期终止区间！");
			return false;
		}
		
		var datetype = document.all.datetype.options;
		if(datetype[0].selected)
		{	
			document.all.startdate.disabled = false;
			document.all.enddate.disabled = false;		
		}	
		
		form1.action = "<%=response.encodeURL(root+"/A400702.do")%>";
		form1.submit();
	}
	
	function changedatetype()
	{
		var datetype = document.all.datetype.options;
		if(datetype[0].selected)
		{			
			if(document.all.startdate.value == null || document.all.startdate.value == "" || !isNum(document.all.startdate.value) || parseInt(document.all.startdate.value) > 31 || parseInt(document.all.startdate.value) < 0)
			{
				document.all.startdate.value = '1';
			}
			if(document.all.enddate.value == null || document.all.enddate.value == "" || !isNum(document.all.enddate.value) || parseInt(document.all.enddate.value) > 31 || parseInt(document.all.enddate.value) < 0)
			{
				document.all.enddate.value = '31';
			}		
			
			document.all.startdate.disabled = true;
			document.all.enddate.disabled = true;	
		
		}
		else
		{
			document.all.startdate.disabled = false;
			document.all.enddate.disabled = false;			
		}
	}
</script>

<body leftmargin="0" topmargin="0" bgcolor="#f5f5f5" >
<input type='hidden' name='currmenu' value='1001'>
<center>

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black" >系统参数设置</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>

<br>

<%
GSBalanceParamBean tBean = (GSBalanceParamBean)request.getAttribute("bean");

%>

<form name="form1" id="form1" method="post"  style="visibility: visible;">
<input type='hidden' name='saveoption' value=''>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr> 
        <td> 
            <table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                <tbody> 
                <tr class="bg_column" height=20> 
                    	<td align=middle colspan="11">系统参数设置</td>
                </tr>
                <tr class="bg_row_odd" height=20> 
                	<td class=top align=middle width='20%' id='aaa'>
                	    <div align="center" class="txt_content">结算日期类型</div>
                	</td>
                	<td class=top align=left width='20%' id='aaa' >
                        	<select id='datetype' name='datetype' onChange='changedatetype()'>
                        		<option value='1' <%="1".equals(tBean.getGs_balance_date_type())?"selected":""%>>自然月</option>
                        		<option value='2' <%="2".equals(tBean.getGs_balance_date_type())?"selected":""%>>手动设定</option>
                        	</select><font color='red'>&nbsp;*</font>
                	</td>
                	
                	<td class=top align=middle> 
	                    <div align="center" class="txt_content">应收应付提醒周期</div>
	                </td>
                    <td class=top align=left nowrap id='linktel'> 
                        	<input type='text' id='period' size='13' name='period' value='<%=tBean.getGs_balance_period()%>'><font color='red'>&nbsp;*</font>
                    </td>   
                </tr>
                
                <tr class="bg_row_odd" height=20> 

	                <td class=top align=left> 
	                    <div align="center" class="txt_content">结算日期开始区间</div>
	                </td>
                    <td class=top align=left > 
                       	<input type='text' id='startdate' size='13' name='startdate' value='<%=tBean.getGs_balance_start_date()==null?"":tBean.getGs_balance_start_date()%>'><font color='red'>&nbsp;*</font>
                    </td>
	                
	                <td class=top align=middle> 
	                    <div align="center" class="txt_content">结算日期终止区间</div>
	                </td>
                    <td class=top align=left > 
                        <input type='text' id='enddate' size='13' name='enddate' value='<%=tBean.getGs_balance_end_date()==null?"":tBean.getGs_balance_end_date()%>'><font color='red'>&nbsp;*</font>
                    </td>
                </tr>           
                </tbody> 
            </table>
        </td>
    </tr>
    <tr  height=20> 
        <td class=top align=left> 
        	<font color='red'>如果结算日期类型选择自然月，则结算日期区间由系统自动设置</font>
        </td>
    </tr>
    
</table>

<center>

</form>

<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>

		<td width=100% align=middle id="submitform">
			<input type="button" class="kuang" value="保存" onclick="saveForm();return false;">
		</td>

	<tr>
</table>

</center>

</body>
</html>
<script language='javascript'>changedatetype();</script>
